//
//  TravelsShareHeadView.m
//  DLTravels
//
//  Created by mac1012 on 2016/12/21.
//  Copyright © 2016年 DianlE. All rights reserved.
//

#import "TravelsShareHeadView.h"

@interface TravelsShareHeadView(){

    UIScrollView *_contentScroll;
    
}

@end

@implementation TravelsShareHeadView

- (instancetype)initWithFrame:(CGRect)frame{

    if (self = [super initWithFrame:frame]) {
        
        _contentScroll = [[UIScrollView alloc] initWithFrame:frame];
        _contentScroll.delegate = self;
        _contentScroll.showsHorizontalScrollIndicator = NO;
        _contentScroll.showsVerticalScrollIndicator = NO;
        
        [_contentScroll setContentSize:CGSizeMake(kScreen_Width, 0)];
        
        NSArray *imageNames = @[@"Share_Head_1",@"Share_Head_2",@"Share_Head_3"];
        for (NSInteger index = 0; index< imageNames.count; index) {
            UIImageView *imgView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, kScreen_Width, CGRectGetHeight(frame))];
            imgView.image = [UIImage imageNamed:imageNames[index]];
            [_contentScroll addSubview:imgView];
        }
        
        UIButton *leftBtn = [UIButton new];
        [_contentScroll addSubview:leftBtn];
        [leftBtn mas_makeConstraints:^(MASConstraintMaker *make) {
           
            make.left.equalTo(_contentScroll.mas_left).offset(4);
            make.width.mas_equalTo(15);
            make.height.mas_equalTo(15);
            make.centerY.equalTo(_contentScroll);
            
        }];
        
        UIButton *rightBtn = [UIButton new];
        [_contentScroll addSubview:rightBtn];
        [rightBtn mas_makeConstraints:^(MASConstraintMaker *make) {
           
            make.right.equalTo(_contentScroll.mas_right).offset(4);
            make.width.mas_equalTo(15);
            make.height.mas_equalTo(15);
            make.centerY.equalTo(_contentScroll);
            
        }];
        
        [leftBtn setBackgroundImage:[UIImage imageNamed:@""] forState:UIControlStateNormal];
        [rightBtn setBackgroundImage:[UIImage imageNamed:@""] forState:UIControlStateNormal];
        
        [_contentScroll addSubview:leftBtn];
        [_contentScroll addSubview:rightBtn];
        
        
    }
    return self;
}




@end
